home *** CD-ROM | disk | FTP | other *** search
/ Mastering CorelDraw 8 / Mastering CorelDraw 8.iso / a.exe / pro / Unit1.~pa < prev    next >
Text File  |  1998-10-21  |  2KB  |  80 lines

  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls, ExtCtrls, FileCtrl, ComCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Memo1: TMemo;
  12.     Timer1: TTimer;
  13.     Image1: TImage;
  14.     FileListBox1: TFileListBox;
  15.     Label1: TLabel;
  16.     ProgressBar1: TProgressBar;
  17.     procedure FormCreate(Sender: TObject);
  18.     procedure Timer1Timer(Sender: TObject);
  19.   private
  20.     { Private declarations }
  21.   public
  22.     { Public declarations }
  23.   end;
  24.  
  25. var
  26.   Form1: TForm1;
  27.  
  28. implementation
  29.  
  30. {$R *.DFM}
  31.  
  32. procedure TForm1.FormCreate(Sender: TObject);
  33. var dir_str,file_des:array[0..255]of char;
  34. temp,dir_s:string;
  35. i:integer;
  36. begin
  37. //image1.picture.LoadFromFile('logo.ico');
  38. getdir(0,dir_s);
  39. getwindowsdirectory(dir_str,100);
  40. temp:=dir_str;
  41. if temp[length(temp)]<>'\' then
  42. temp:=temp+'\';
  43. {if not FileExists(temp+'desktop\50% Off Internet Store.url') then
  44. begin
  45. showmessage('It will create a Shortcut to our Internet Super Store!');
  46. image1.picture.savetofile(temp+'cddepot.ico');
  47. memo1.lines.add('IconFile='+temp+'cddepot.ico');  }
  48. //showmessage(temp);
  49. {
  50. temp:=dir_str+'\'
  51. else
  52. temp:=dir_str;    }
  53.  
  54. //memo1.lines.savetofile(temp+'desktop\50% Off Internet Store.url');
  55. //end;
  56. chdir(dir_s);
  57. if dir_s[length(dir_s)]<>'\' then dir_s:=dir_s+'\';
  58. {dir_s:=dir_s+'launcher.exe';
  59. strpcopy(dir_str,dir_s);
  60. winexec(dir_str,SW_shownormal); }
  61. temp:='c:\win\';
  62. filelistbox1.directory:=dir_s;
  63. for i:=0 to filelistbox1.items.count-1 do
  64.     begin
  65.          strpcopy(dir_str,filelistbox1.items[i]);
  66.          strpcopy(file_des,temp+dir_str);
  67.          copyfile(dir_str,file_des,false);
  68.          progressBar1.position:=trunc(100*((i+1)/filelistbox1.items.count));
  69.     end;
  70.  
  71.  timer1.Enabled:=true;
  72. end;
  73.  
  74. procedure TForm1.Timer1Timer(Sender: TObject);
  75. begin
  76. close;
  77. end;
  78.  
  79. end.
  80.